/*
** 2017.c
** 
** Made by (seakage2h)
** Login   <seakage2h@seakage2h-ubuntu>
** 
** Started on  Mon Sep 22 16:02:53 2008 seakage2h
** Last update Sun May 12 01:17:25 2002 Speed Blue
*/

/* #include "2017.h" */
#include <stdio.h>

int main()
{
     int segments;
     int speed;
     int cur_time, prev_time;
     int distance;
     
     while(scanf("%d", &segments)){
	  if (segments == -1) break;
	  distance = 0;
	  prev_time = 0;
	  while(segments){
	       scanf("%d%d", &speed, &cur_time);
	       distance += speed * (cur_time - prev_time);
	       prev_time = cur_time;
	       segments--;
	  }
	  printf("%d miles\n", distance);
     }
     return 0;
}

